<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>

<%@ page import="com.google.appengine.api.users.User" %>
<%@ page import="com.google.appengine.api.users.UserService" %>
<%@ page import="com.google.appengine.api.users.UserServiceFactory" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link href="/css/css.css" rel="stylesheet" media="screen" type="text/css" />
<title>Rettiwt</title>
</head>
<body>
<div style="position: relative; margin: 0 auto; width: 400px; height: 300px; top: 100px;">
<%
	UserService userService = UserServiceFactory.getUserService();
    User user = userService.getCurrentUser();
    if (userService.isUserLoggedIn()) {    	
    	response.sendRedirect(request.getContextPath() + "/main");
    } else {
%>
	<p>Bem vindo!
	<a style="font-size: 20px;" href="<%= userService.createLoginURL("/main") %>">Clique Aqui</a>
para se conectar ao sistema</p>
<%
}
%>
</div>
</body>
</html>